import { User } from 'my-web-core/auth';
import React from 'react';
import { Route } from 'react-router-dom';

import { getGuardedElement } from '@/shared/components/RouterHelper';

const rootPath: string = '/home';

const Home = React.lazy(() => import('@/features/home/components/Home'));

function getHomeRoute(currentUser: User | null) {
  return <Route path={rootPath} element={getGuardedElement(rootPath, <Home />, currentUser)} />;
}

export default getHomeRoute;
